<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v-html指令</title>
</head>

<body>

  <div id="app">
    <!-- 1. 直接渲染 -->
    <h4>{{ html }}</h4>

    <!-- 2. 使用html方式渲染 -->
    <h4 v-html="html"></h4>
  </div>

  <script src="../../js/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        message: 'hello',
        html: `<a href="http://www.baidu.com">百度一下，你就知道</a>`
      }
    })
  </script>
</body>

</html>